Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Jump-To hotkeys #3483

Merged
merged 18 commits into from
Aug 20, 2024
Merged

Add Jump-To hotkeys #3483

merged 18 commits into from
Aug 20, 2024

Conversation

dbolack-ab
Copy link
Collaborator

@dbolack-ab dbolack-ab commented May 18, 2024

This binds CTRL/META-SHIFT-LEFTARROW to brewJump and CTRL/META-SHIFT-RIGHTARROW to sourceJump.

Solves part one in #241

edit: Reflect change in hotkey binding.

  • Agree on which key binds to which jump.
  • Verify brewJump Binding on PC
  • Verify SourceJump Binding on PC
  • Verify brewJump Binding on MAC
  • Verify SourceJump Binding on MAC
  • Verify brewJump Binding on a Linux
  • Verify SourceJump Binding on a Linux

This binds CTRL/META-J to brewJump and SHIFT-CTRL/META-J to sourceJump.
@5e-Cleric
Copy link
Member

5e-Cleric commented May 18, 2024

Those hotkeys are already in use in chrome
For me they open downloads, and dev tools console respectively.

image

https://support.google.com/chrome/answer/157179?hl=en&co=GENIE.Platform%3DDesktop

@5e-Cleric 5e-Cleric added the 🔍 R0 - Needs first review 👀 PR ready but has not been reviewed label May 19, 2024
@calculuschild
Copy link
Member

calculuschild commented May 19, 2024

Now, we don't need to add more hotkeys at all (I would actually prefer we don't). One person in the original issue only suggested it as a lesser alternative if we couldn't get scroll linking to work, but the other PR takes care of that.

@dbolack-ab
Copy link
Collaborator Author

Now, we don't need to add more hotkeys at all (I would actually prefer we don't). One person in the original issue only suggested it as a lesser alternative if we couldn't get scroll linking to work, but the other PR takes care of that.

As a primarily hot key user, I know I would use the keys more than the buttons and live scrolling would annoy the crap out of me.

@calculuschild
Copy link
Member

Fair enough. Just didn't want to add a feature if nobody actually wanted it.

@Gazook89
Copy link
Collaborator

I think hotkeys for navigating the page is a good idea. And this counts as navigating the page (it is changing the view).

I do think we can remove hotkeys for many snippets (and I made most of those hot keys so no one should be offended). The snippet menus themselves should have better keyboard navigation (cough radix cough), but in the meantime if there is a snippet hot key that would be better used for something else, I think it’s fine to claim it.

I intend to work on snippet menu very soon, 1) to convert to function components and 2) look at keyboard navigation and/or radix.

@5e-Cleric
Copy link
Member

5e-Cleric commented Jun 1, 2024

I'm sorry but:

https://homebrewery.naturalcrit.com/share/1Em9UpHcoKws3xv65lWCRGzPDr3xPAWzvp9-Fp6cxI0Ac

Ctrl-M is used to input spans.

Usual problem with hotkeys, every damn program uses them, windows, chrome, HB...

CTRL-SHIFT-LEFTARROW - Source Jump
CTRL-SHIFT-RIGHTARROW - Brew Jump
@G-Ambatte
Copy link
Collaborator

CTRL+SHIFT+RIGHT moves the editor, on the left half of the screen
CTRL+SHIFT+LEFT moves the preview, on the right half of the screen

To me, this feels backwards - that it would be more intuitive if the operation were reversed.


This is, of course, a matter of opinion.

@dbolack-ab
Copy link
Collaborator Author

CTRL+SHIFT+RIGHT moves the editor, on the left half of the screen CTRL+SHIFT+LEFT moves the preview, on the right half of the screen

To me, this feels backwards - that it would be more intuitive if the operation were reversed.

I really don't have a strong opinion one way or the other.

@dbolack-ab
Copy link
Collaborator Author

Does anyone have strong feelings over which arrow should impact which direction?

@calculuschild @G-Ambatte @ericscheid @5e-Cleric

@calculuschild
Copy link
Member

I would say the arrow should indicate the direction of info transfer. I.e. pointing right is sending the position from left to right.

@Gazook89
Copy link
Collaborator

With the :has() selector, or one of the other newer ones, could we style each pane based on which "scroll arrow" is being hovered?

This is kind of funky idea, but if a user is hovering the "scroll preview to match editor" button, the preview pane would show a faint, but visible, double-sided arrow overlaid on it. And vice versa.

Quick mockup, for hovering the "scroll preview to match editor":
image

I've spent about 0.5 seconds thinking of the css for this, but it seems like it should be possible (or maybe it's a JS thing). Maybe it even points which direction the pane will scroll....(but then you could have another argument about which way an arrow should point to indicate the page will scroll "up")

Obviously this doesn't solve the immediate question about which way arrows point, but I think it would make it very clear to the user what is about to happen, both on the 'first try' and every subsequent try.

@calculuschild calculuschild temporarily deployed to homebrewery-pr-3483 August 20, 2024 18:49 Inactive
@calculuschild
Copy link
Member

Looks good. Gonna merge this.

@calculuschild calculuschild merged commit 787d50f into naturalcrit:master Aug 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 R0 - Needs first review 👀 PR ready but has not been reviewed
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants